<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<script>
try{
    a+b;
}catch (error){
    alert("非法的变量。");
}

</script>
</head>
<body>
</body>
</html> 



